import type { postOrPutType } from "@/constants";
import type { IList, IResult } from "@/types/common";
import { getAxios, commonAxiosJson, deleteAxios } from "@/utils/request.js";
/* 客服排班地址 */
const url = "/admin/user/customer-schedule-v3";

/* 获取对应平台一个月具体是否排班过的信息 */
export const getScheduleList = <T, D>(params?: D): Promise<IResult<IList<T>>> => {
  return getAxios<IList<T>, D>(url, params);
};
/* 新增，编辑排班信息 */
export const commonScheduleInfo = <T, D>(params: D, type: postOrPutType): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url, params, type);
};
/* 删除排班信息 */
export const deleteScheduleInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return deleteAxios<T, D>(url, params);
};
